package com.guigu.basedservice.controller;


import com.github.pagehelper.PageInfo;
import com.guigu.basedservice.entity.BaseCarBrand;
import com.guigu.basedservice.entity.BaseCarCategory;
import com.guigu.basedservice.entity.BaseCarFactory;
import com.guigu.basedservice.service.BaseCarCategoryService;
import com.guigu.basedservice.service.BaseCarFactoryService;
import com.guigu.basedservice.vo.BaseCarCategoryVo;
import com.guigu.basedservice.vo.BaseCarFactoryVo;
import com.guigu.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 车系 前端控制器
 * </p>
 *
 * @author Heyuhang
 * @since 2024-09-12
 */
@CrossOrigin
@Api(description = "BaseCarCategory请求控制类")
@RestController
@RequestMapping("/basedservice/base-car-category")
public class BaseCarCategoryController {

    @Autowired
    private BaseCarCategoryService baseCarCategoryService;

    @ApiOperation("查询所有BaseCarCategory分页数据")
    @RequestMapping("/show/{currentPage}/{pageSize}")
    public R show(
            @PathVariable Integer currentPage,
            @PathVariable Integer pageSize,
            BaseCarCategoryVo vo
    ){
        System.out.println("hao"+vo);
        PageInfo<BaseCarCategory> baseCarCategoryPageInfo = baseCarCategoryService.show(vo,currentPage, pageSize);
        return R.ok().data("baseCarCategoryPageInfo", baseCarCategoryPageInfo);
    }

    @ApiOperation("查询所有BaseCarCategory分页数据")
    @RequestMapping("/list")
    public List<BaseCarCategory> list(){
        return baseCarCategoryService.list(null);
    }
}

